<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of cargar_usuarios
 *
 * @author jose
 */
class Cargar_usuarios extends MN_Controller {
    //put your code here
    function __construct() {
        parent::__construct();
        $this->load->database();
        $this->load->helper(array('url', 'form'));
        $this->load->library('ion_auth');
        $this->load->library('session');
        $this->load->model('Estudiante_Model');
    }
     public function inicio() {
        
        $data = $this->Estudiante_Model->getMatriculadosPorSemestreCarreraCicloJornada(10,0,0,0,0,"X");        //echo 'sss '.  count($data);
        foreach ($data as $item){
            $username=$item["username_pers"];
            $password=$item["username_pers"];
            $email=$item["email_inst_pers"];
            $additional_data = array(
                'first_name' => $item["nombre_pers"],
                'last_name' => $item["apellido_pers"],
                'company' => 'Suadmericano',
                'phone' => $item["fono_pers"],
                'ide_pers' => $item["ide_pers"]
            );
            $group_name= array("id"=>5);
            $this->ion_auth->register($username, $password, $email, $additional_data,$group_name);
            print_r($item);
            //echo 'Realizado';
            //http://localhost/~jose/acad/docente.php/cargar_usuarios/inicio
        }
        //$group_name= array("id"=>5);
        //$group_name[0]["name"] = "student";
        //print_r($group_name);
    }
      public function prueba(){
             $this->load->library('utilidades');
             //$this->utilidades->trozarPalabras("LABORATORIO DE PROGRAMACIÓN I");
             //$lista = $this->docente_model->cargarMaterias(890);
             $this->utilidades->listaMaterias(890);
        }
}

?>
